package com.rain.cy.business.model.dto;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.rain.cy.business.model.entity.UserProcessDataEntity;
import com.rain.cy.business.model.json.BaseProcessDataJson;
import com.rain.cy.framework.entity.BaseEntity;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;

/**
 * <p>
 *
 * </p>
 *
 * @author yuchen
 * @since 2021-10-02
 */
@Data
@Accessors(chain = true)
public class UserProcessDataDTO {

    private static final long serialVersionUID = 1L;


    /**
     * 主键ID
     */
    private Integer id;
    /**
     * 流程ID
     */
    private String processId;

    /**
     * 流程数据（json）
     */
    private String processData;

    /**
     * 患者ID
     */
    private Integer userId;

    /**
     * 医生的ID
     */
    private Integer doctorUserId;

    /**
     * 创建时间
     */
    private String createDay;

    /**
     * processData的json格式
     */
    private BaseProcessDataJson baseProcessDataJson;


    public static UserProcessDataDTO from(UserProcessDataEntity userProcessDataEntity) {
        return BeanUtil.copyProperties(userProcessDataEntity, UserProcessDataDTO.class);

    }

    public static UserProcessDataEntity to(UserProcessDataDTO userProcessDataDTO) {
        return BeanUtil.copyProperties(userProcessDataDTO, UserProcessDataEntity.class);
    }

}
